<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>  
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <title>Wild Fire Learning Solutions</title>
  <link href="css/style.css" rel="stylesheet" type="text/css" />
  <script src="datafeed.js" type="text/javascript"></script>

</head>


<body>
<div id="contain">
	<?php include("header.php"); ?>

<!--Navigation and LHS-->
	<div id="leftcol">
		<?php include("menu.php"); ?>
	</div>
<!-- Nav ends -->

<!-- Content (RHS) -->
<div id="content">
<p>
<?php
session_start();
//############################################
//Now import the settings
include_once("settings.php");

//############################################
//Connect to the db
mysql_connect($db_host,$MySqlUN,$MySqlPW);
@mysql_select_db($database) or die( "Unable to select databases");

if(isset($_POST['qty'])) {
$qty = $_POST['qty'];
}
if(isset($_POST['products_prodnum'])) {
$prodnum = $_POST['products_prodnum'];
}
if(isset($_POST['modified_hidden'])) {
$modified_hidden = $_POST['modified_hidden'];
}
if(isset($_POST['modified_quan'])) {
$modified_quan = $_POST['modified_quan'];
}
$sess = session_id();
$action = $_REQUEST['action'];

switch($action) {
case "add":
$query = "insert into carttemp (
			carttemp_sess,
			carttemp_quan,
			carttemp_prodnum)
			values('$sess','$qty','$prodnum')";
$message = "<div align=\"center\"><strong>Item added.</strong></div>";
break;

case "change":
$query = "update carttemp
			set carttemp_quan = '$modified_quan'
			where carttemp_hidden = '$modified_hidden'";
$message = "<div align='center'><strong>Quantity changed.</strong></div>";
break;

case "delete":
$query = "delete from carttemp		
			where carttemp_hidden = '$modified_hidden'";
$message = "<div align='center'><strong>Item deleted.</strong></div>";
break;

case "empty":
$query = "delete from carttemp
			where carttemp_sess = '$sess'";
$message = "<div align='center'><strong>Cart emptied.</strong></div>";
break;
}

$results = mysql_query($query) or die(mysql_error());
echo $message;
include("cart.php");
?> 


</p>
</div>
<!-- content ends (RHS) -->
<?php include("footer.php"); ?>
</div>
</body>
</html>